package com.zygh.lz.controller;

import com.zygh.lz.entity.Urban;
import com.zygh.lz.service.UrbanService;
import com.zygh.lz.stapprove.SysPcLog;
import com.zygh.lz.vo.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "郑州各区管理模块")
@RestController
public class UrbanController {
    @Resource
    private UrbanService urbanService;

    @ApiOperation("查询所有区域")
    @GetMapping("selectAllUrban")
    public ResultBean selectAllUrban() {
        return urbanService.selectAllUrban();
    }

    @ApiOperation("新增区域")
    @PostMapping("insertUrban")
    //@SysPcLog(module = "新增区域",operation = "新增")
    public ResultBean insertUrban(@RequestBody Urban urban) {
        return urbanService.insertUrban(urban);
    }

    @ApiOperation("删除区域")
    @GetMapping("deleteSomeUrban")
    //@SysPcLog(module = "删除区域",operation = "删除")
    public ResultBean deleteSomeUrban(Integer id) {
        return urbanService.deleteSomeUrban(id);
    }

    @ApiOperation("修改区域")
    @GetMapping("updateUrban")
    //@SysPcLog(module = "修改区域",operation = "修改")
    public ResultBean updateUrban(Urban urban) {
        return urbanService.updateUrban(urban);
    }

    @ApiOperation("区域管辖查询")
    @GetMapping("seleteDimUrban")
    public ResultBean seleteDimUrban(Urban urban) {
        return urbanService.seleteDimUrban(urban);
    }

    @ApiOperation("按照大队统计各管辖区域发现问题数目。统计")
    @GetMapping("selectUrbanByCount")
    public ResultBean selectUrbanByCount(Integer sectionId) {
        return urbanService.selectUrbanByCount(sectionId);
    }


}
